package com.zrar.ak.gkpt.controller;

import com.zrar.ak.gkpt.model.bo.*;
import com.zrar.ak.gkpt.model.vo.SchemeContainerVO;
import com.zrar.ak.gkpt.util.CommonTools;
import com.zrar.ak.gkpt.util.FormDataParameter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class TestController {



    public static void main(String[] args) {
        TestController test = new TestController();

        /**
         * 台账基本信息
         */
        //test.accountBasicInfo();
        /**
         * 台账扩展信息
         */
        //test.accountExpandInfo();

        /**
         * 测试验证
         */
        test.schemeAdd();

        /**
         * 备案信息-合同备案录入数据
         */
        //test.recordContract();
        /**
         * 备案信息-招投标备案录入数据
         */
        //test.recordBid();
        /**
         * 备案信息-验收备案录入数据
         */
        //test.recordAccept();
        /**
         * 备案信息-资金使用备案录入数据
         */
        //test.recordFunds();

    }

    /**
     * 台账基本信息
     */
    public void accountBasicInfo(){
        BusinessAccountBasicInfoBO form = new BusinessAccountBasicInfoBO();
        form.setUnitId("111");
        form.setUnitName("我是下级单位A");
        form.setTerminalNonSecretNum(333);
        form.setTerminalSecretNum(333);
        form.setServerSecretNum(333);
        form.setServerNonSecretNum(333);
        form.setPrinterNum(333);
        form.setSystemAdaptationNum(333);
        form.setSystemImproveNum(333);
        form.setSystemCloudNum(333);
        form.setBudgetFundsTotal(333.333);
        form.setBudgetFundsTotal2020(333.333);
        form.setAccountAnnexId("我是附件id");
        form.setAccountAnnexName("我是附件名称");

        String s = CommonTools.objectToJsonStr(form);
        System.out.println(s);

        FormDataParameter formData = new FormDataParameter();
        formData.setFormDataJson(s);
        String s1 = CommonTools.objectToJsonStr(formData);
        System.out.println(s1);
    }
    /**
     * 台账基本信息
     */
    public void accountExpandInfo(){
        BusinessAccountExpandInfoBO form = new BusinessAccountExpandInfoBO();
        form.setUnitId("111");
        form.setUnitName("我是下级单位A");

        String s = CommonTools.objectToJsonStr(form);
        System.out.println(s);

        FormDataParameter formData = new FormDataParameter();
        formData.setFormDataJson(s);
        String s1 = CommonTools.objectToJsonStr(formData);
        System.out.println(s1);
    }


    /**
     * 备案信息-合同备案录入数据
     */
    public void recordContract(){
        //备案信息-合同备案
        FormRecordContractTBO formRecordContractTBO = new FormRecordContractTBO();
        formRecordContractTBO.setBuildUnitCode("111");
        formRecordContractTBO.setContractSigningTime(new Date());
        formRecordContractTBO.setTotalContractAmount(22.222);
        formRecordContractTBO.setTechnologyRoadmap("我是技术路线B");
        formRecordContractTBO.setAggregateUnit("我是总集单位B");
        formRecordContractTBO.setConstructionContent("我是具体建设内容描述B");
        formRecordContractTBO.setTestRunStartTime(new Date());
        formRecordContractTBO.setTestRunEndTime(new Date());
        formRecordContractTBO.setGoLiveTime(new Date());
        formRecordContractTBO.setTaskAcceptTime(new Date());
        formRecordContractTBO.setCompletedAcceptTime(new Date());
        formRecordContractTBO.setContractAnnex("我是合同附件B");

        //备案信息表_合同备案_终端_子表
        List<FormRecordContractTerminalTiBO> listTerminal1 = new ArrayList<FormRecordContractTerminalTiBO>();
        FormRecordContractTerminalTiBO formRecordContractTerminalTiBO = new FormRecordContractTerminalTiBO();
        formRecordContractTerminalTiBO.setOrderNum(1);
        formRecordContractTerminalTiBO.setTerminalBrand("我是终端品牌1");
        formRecordContractTerminalTiBO.setTerminalAmount(111);
        formRecordContractTerminalTiBO.setTerminalManufactor("我是终端厂家1");
        listTerminal1.add(formRecordContractTerminalTiBO);

        FormRecordContractTerminalTiBO formRecordContractTerminalTiBO1 = new FormRecordContractTerminalTiBO();
        formRecordContractTerminalTiBO1.setOrderNum(2);
        formRecordContractTerminalTiBO1.setTerminalBrand("我是终端品牌2");
        formRecordContractTerminalTiBO1.setTerminalAmount(222);
        formRecordContractTerminalTiBO1.setTerminalManufactor("我是终端厂家2");
        listTerminal1.add(formRecordContractTerminalTiBO1);

        //备案信息表_合同备案_服务器_子表
        List<FormRecordContractServerTiBO> listServer1 = new ArrayList<FormRecordContractServerTiBO>();
        FormRecordContractServerTiBO formRecordContractServerTiBO = new FormRecordContractServerTiBO();
        formRecordContractServerTiBO.setOrderNum(1);
        formRecordContractServerTiBO.setServerBrand("我是服务器品牌1");
        formRecordContractServerTiBO.setServerManufactor("我是服务器1");
        formRecordContractServerTiBO.setServerAmount(111);
        listServer1.add(formRecordContractServerTiBO);

        FormRecordContractServerTiBO formRecordContractServerTiBO1 = new FormRecordContractServerTiBO();
        formRecordContractServerTiBO1.setOrderNum(2);
        formRecordContractServerTiBO1.setServerBrand("我是服务器品牌2");
        formRecordContractServerTiBO1.setServerManufactor("我是服务器2");
        formRecordContractServerTiBO1.setServerAmount(111);
        listServer1.add(formRecordContractServerTiBO1);

        FormRecordContractServerTiBO formRecordContractServerTiBO2 = new FormRecordContractServerTiBO();
        formRecordContractServerTiBO2.setOrderNum(3);
        formRecordContractServerTiBO2.setServerBrand("我是服务器品牌3");
        formRecordContractServerTiBO2.setServerManufactor("我是服务器3");
        formRecordContractServerTiBO2.setServerAmount(111);
        listServer1.add(formRecordContractServerTiBO2);

        //备案信息表_合同备案_应用系统_子表
        List<FormRecordContractSystemTiBO> listSystem1 = new ArrayList<FormRecordContractSystemTiBO>();
        FormRecordContractSystemTiBO formRecordContractSystemTiBO = new FormRecordContractSystemTiBO();
        formRecordContractSystemTiBO.setOrderNum(1);
        formRecordContractSystemTiBO.setSystemName("我是应用系统名称1");
        formRecordContractSystemTiBO.setSystemMode("我是应用系统模式1");
        formRecordContractSystemTiBO.setSystemAnkeCloud("1");
        listSystem1.add(formRecordContractSystemTiBO);


        formRecordContractTBO.setFormRecordContractTerminalTiBOList(listTerminal1);
        formRecordContractTBO.setFormRecordContractServerTiBOList(listServer1);
        formRecordContractTBO.setFormRecordContractSystemTiBOList(listSystem1);

        String s = CommonTools.objectToJsonStr(formRecordContractTBO);
        FormDataParameter formData = new FormDataParameter();
        formData.setFormDataJson(s);
        String s1 = CommonTools.objectToJsonStr(formData);
        System.out.println("我是合同备案");
        System.out.println(s1);

    }

    /**
     * 备案信息-招投标备案录入数据
     */
    public void recordBid(){
        //备案信息-招投标备案
        FormRecordBidTBO formRecordBidTBO = new FormRecordBidTBO();
        formRecordBidTBO.setBuildUnitCode("111");
        formRecordBidTBO.setBidStartupTime(new Date());
        formRecordBidTBO.setPlanBidOpenTime(new Date());
        formRecordBidTBO.setActualBidOpenTime(new Date());
        formRecordBidTBO.setConfirmationBidding("0");
        formRecordBidTBO.setBidAnnex("我是招投标附件");
        formRecordBidTBO.setBidAnnexName("我是招投标附件名字");

        String s = CommonTools.objectToJsonStr(formRecordBidTBO);
        FormDataParameter formData = new FormDataParameter();
        formData.setFormDataJson(s);
        String s1 = CommonTools.objectToJsonStr(formData);
        System.out.println("我是招投标备案");
        System.out.println(s1);
    }

    /**
     * 备案信息-验收备案录入数据
     */
    public void recordAccept(){
        //备案信息-验收备案
        FormRecordAcceptTBO formRecordAcceptTBO = new FormRecordAcceptTBO();
        formRecordAcceptTBO.setBuildUnitCode("111");
        formRecordAcceptTBO.setTaskAcceptPlanTime(new Date());
        formRecordAcceptTBO.setTaskAcceptCompletionTime(new Date());
        formRecordAcceptTBO.setTaskAcceptConclusion("我是任务验收结论");
        formRecordAcceptTBO.setTaskAcceptScore(99);
        formRecordAcceptTBO.setTaskAcceptExpertOpinion("我是任务验收专家意见");
        formRecordAcceptTBO.setTaskAcceptExpertModify("我是任务验收专家意见修改");
        formRecordAcceptTBO.setCompletedAcceptPlanTime(new Date());
        formRecordAcceptTBO.setCompletedAcceptCompletionTime(new Date());
        formRecordAcceptTBO.setCompletedAcceptConclusion("我是竣工验收结论");
        formRecordAcceptTBO.setCompletedAcceptScore(0);
        formRecordAcceptTBO.setCompletedAcceptExpertOpinion("我是竣工验收专家意见");
        formRecordAcceptTBO.setCompletedAcceptExpertModify("我是竣工验收专家意见修改");

        String s = CommonTools.objectToJsonStr(formRecordAcceptTBO);
        FormDataParameter formData = new FormDataParameter();
        formData.setFormDataJson(s);
        String s1 = CommonTools.objectToJsonStr(formData);
        System.out.println("我是验收备案");
        System.out.println(s1);
    }

    /**
     * 备案信息-资金使用备案录入数据
     */
    public void recordFunds(){
        //备案信息-资金使用备案
        FormRecordFundsTBO formRecordFundsTBO = new FormRecordFundsTBO();
        formRecordFundsTBO.setBuildUnitCode("111");
        formRecordFundsTBO.setProjectFundsTotal(3030.3033);
        formRecordFundsTBO.setFundsInPlace(2020.2022);
        formRecordFundsTBO.setFundsPaid(1010.10111);
        formRecordFundsTBO.setFundsWaitPay(999.99);

        String s = CommonTools.objectToJsonStr(formRecordFundsTBO);
        FormDataParameter formData = new FormDataParameter();
        formData.setFormDataJson(s);
        String s1 = CommonTools.objectToJsonStr(formData);
        System.out.println("我是资金使用备案");
        System.out.println(s1);
    }



    public void test(){
        BusinessTestVerifyBO businessTestVerifyBO = new BusinessTestVerifyBO();
        businessTestVerifyBO.setUnitName("华为");
        businessTestVerifyBO.setSystemName("玩儿");
        businessTestVerifyBO.setModel("1");
        businessTestVerifyBO.setCpuName("糟心");
        businessTestVerifyBO.setOperatingSystemName("中标操作系统");
        businessTestVerifyBO.setVerifyResult("1");
        businessTestVerifyBO.setComments("二手房");

        String s = CommonTools.objectToJsonStr(businessTestVerifyBO);
        FormDataParameter formData = new FormDataParameter();
        formData.setFormDataJson(s);
        String s1 = CommonTools.objectToJsonStr(formData);
        System.out.println("我是测试验证");
        System.out.println(s1);

    }
    public void schemeAdd(){
        BusinessSchemePeripheralInfoBO peripheralInfoBO1 = new BusinessSchemePeripheralInfoBO();
        BusinessSchemePeripheralInfoBO peripheralInfoBO2 = new BusinessSchemePeripheralInfoBO();
        BusinessSchemeServerInfoBO serverInfoBO1 = new BusinessSchemeServerInfoBO();
        BusinessSchemeServerInfoBO serverInfoBO2 = new BusinessSchemeServerInfoBO();
        BusinessSchemeSoftwareHardwareInfoBO soft1 = new BusinessSchemeSoftwareHardwareInfoBO();
        BusinessSchemeSoftwareHardwareInfoBO soft2 = new BusinessSchemeSoftwareHardwareInfoBO();
        BusinessSchemeSystemInfoBO systemInfoBO1 = new BusinessSchemeSystemInfoBO();
        BusinessSchemeSystemInfoBO systemInfoBO2 = new BusinessSchemeSystemInfoBO();
        BusinessSchemeTerminalInfoBO terminalInfoBO1 = new BusinessSchemeTerminalInfoBO();
        BusinessSchemeTerminalInfoBO terminalInfoBO2 = new BusinessSchemeTerminalInfoBO();

        /**
         * 终端
         */
        ArrayList<BusinessSchemeTerminalInfoBO> list1 = new ArrayList<>();
        terminalInfoBO1.setTerminalSystemName("aa");
        terminalInfoBO1.setTerminalType("0");
        terminalInfoBO1.setTerminalTotalNum(12);
        terminalInfoBO1.setTerminalReplaceNum(2);
        terminalInfoBO1.setTerminalDeploymentLocation("2");
        terminalInfoBO1.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");

        terminalInfoBO2.setTerminalSystemName("aa");
        terminalInfoBO2.setTerminalType("1");
        terminalInfoBO2.setTerminalTotalNum(21);
        terminalInfoBO2.setTerminalReplaceNum(5);
        terminalInfoBO2.setTerminalDeploymentLocation("1");
        terminalInfoBO2.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");
        list1.add(terminalInfoBO1);
        list1.add(terminalInfoBO2);

        /**
         * 服务器端
         */
        ArrayList<BusinessSchemeServerInfoBO> list2 = new ArrayList<>();
        serverInfoBO1.setServerSystemName("aa");
        serverInfoBO1.setServerType("0");
        serverInfoBO1.setServerTotalNum(12);
        serverInfoBO1.setServerReplaceNum(2);
        serverInfoBO1.setServerDeploymentLocation("0");
        serverInfoBO1.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");

        serverInfoBO2.setServerSystemName("aa");
        serverInfoBO2.setServerType("1");
        serverInfoBO2.setServerTotalNum(32);
        serverInfoBO2.setServerReplaceNum(3);
        serverInfoBO2.setServerDeploymentLocation("1");
        serverInfoBO2.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");
        list2.add(serverInfoBO1);
        list2.add(serverInfoBO2);

        /**
         * 应用
         */
        ArrayList<BusinessSchemeSystemInfoBO> list3 = new ArrayList<>();
        systemInfoBO1.setSystemName("aa");
        systemInfoBO1.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");
        systemInfoBO1.setFunctionAdjust("0");
        systemInfoBO1.setIsCloud("0");
        systemInfoBO1.setModel("0");
        systemInfoBO1.setMainFunction("测试");
        systemInfoBO1.setSystemDeploymentLocation("0");
        systemInfoBO1.setSystemPurpose("测试");

        systemInfoBO2.setSystemName("aa");
        systemInfoBO2.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");
        systemInfoBO2.setFunctionAdjust("1");
        systemInfoBO2.setIsCloud("1");
        systemInfoBO2.setModel("1");
        systemInfoBO2.setMainFunction("测试ee");
        systemInfoBO2.setSystemDeploymentLocation("1");
        systemInfoBO2.setSystemPurpose("测试ee");
        list3.add(systemInfoBO1);
        list3.add(systemInfoBO2);

        /**
         * 外设
         */
        ArrayList<BusinessSchemePeripheralInfoBO> list4 = new ArrayList<>();
        peripheralInfoBO1.setPeripheralType("0");
        peripheralInfoBO1.setPeripheralTerminalType("0");
        peripheralInfoBO1.setPeripheralReplaceNum(12);
        peripheralInfoBO1.setPeripheralTotalNum(3);
        peripheralInfoBO1.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");

        peripheralInfoBO2.setPeripheralType("0");
        peripheralInfoBO2.setPeripheralTerminalType("0");
        peripheralInfoBO2.setPeripheralReplaceNum(12);
        peripheralInfoBO2.setPeripheralTotalNum(3);
        peripheralInfoBO2.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");
        list4.add(peripheralInfoBO1);
        list4.add(peripheralInfoBO2);

        /**
         * 软硬件
         */
        ArrayList<BusinessSchemeSoftwareHardwareInfoBO> list5 = new ArrayList<>();
        soft1.setSoftType("0");
        soft1.setReplaceNum(12);
        soft1.setEquipmentTotalNum(4);
        soft1.setTerminalServerType("0");
        soft1.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");

        soft2.setSoftType("1");
        soft2.setReplaceNum(32);
        soft2.setEquipmentTotalNum(22);
        soft2.setTerminalServerType("1");
        soft2.setBasicsId("1ca5c8d2b6d34615a6b2af4af7b8f7f2");
        list5.add(soft1);
        list5.add(soft2);

        SchemeContainerVO schemeContainerVO = new SchemeContainerVO();
        schemeContainerVO.setSoft(list5);
        schemeContainerVO.setTerminal(list1);
        schemeContainerVO.setSystem(list3);
        schemeContainerVO.setServer(list2);
        schemeContainerVO.setPeripheral(list4);


        String s = CommonTools.objectToJsonStr(schemeContainerVO);
        FormDataParameter formData = new FormDataParameter();
        formData.setFormDataJson(s);
        String s1 = CommonTools.objectToJsonStr(formData);
        System.out.println("我是测试验证");
        System.out.println(s1);

    }
}
